package cn.shengongying.dao;

import cn.shengongying.model.Customer;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 用户/雇主表 Mapper 接口
 * </p>
 *
 * @author RXK
 * @since 2022-01-05
 */
@Repository
public interface CustomerMapper extends BaseMapper<Customer> {

    Customer findByPhone(@Param("phone") String phone);

    int insertNew(Customer customer);

    List<Customer> listAndPage(@Param("nickName") String nickName, @Param("telephone") String telephone, @Param("type") Integer type, @Param("start") int start, @Param("length") int length);

    int count(@Param("nickName") String nickName, @Param("telephone") String telephone, @Param("type") Integer type);

    List<Integer> statistic(@Param("type") Integer type);

}
